<?php $this->_extends("_layouts/main_layout");?>
<?php $this->_block("contents");?>
<?php echo $alert;?>
<script language="javascript">
$(function(){
	$('#form_opnews').submit(function(){
		var verify_msg = '';
		verify_msg = '您确定要修改本用户的新闻权限吗？';
		if(confirm(verify_msg)){
			return true;	
		}else{
			return false;	
		}
	});
	$('#select_all').click(function(){
		$("input[name='news_op[]']").prop({
		  checked: this.checked
		});
	});
});
</script>
<form class="fsimple" id="form_opnews" name="form_opnews" action="" method="post" enctype="multipart/form-data" >
<table width="100%">
      <tr height="30">
        <td><b>登陆账号：<?php echo $myData['username'];?></b>&nbsp;&nbsp;<font color=red><b>注：一个都不选，就是拥有所有的栏目</b></font></td>
      </tr>
</table>
<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <th>序号</th>
    <th>选择 <input type="checkbox" name="select_all" id="select_all" value="hello" /></th>
    <th>名称</th>
  </tr>
  <?php
	//print_r($list);
	$my_news_op = array();
	if(!empty($myData['news_op'])){
		$my_news_op = explode(',',$myData['news_op']);	
	}
	$count = 0;
 	foreach ($list as $k => $v) {
	 $count ++;
	 ?>
  <tr>
    <td><?php echo $count?></td>
    <td align="left" ><input type="checkbox" name="news_op[]" value="<?php echo $k;?>" <?php if(in_array($k,$my_news_op)){echo 'checked';}?>/>
    </td>
    <td align="left" style=" text-align:left;"><?php echo str_replace('━━','&nbsp;&nbsp;&nbsp;&nbsp;',$v);?></td>

  </tr>
  <? }?>
</table>
<input type="submit" class="btn" value="保存" />
<input type="button" class="btn" value="返回" onclick="history.back()" />
</form>
<br>
<? $this->_endblock();?>
